package com.tueye.service;

import java.util.List;
import java.util.Map;

import com.tueye.base.util.Page;
import com.tueye.entity.Comment;
import com.tueye.entity.Pictures;
import com.tueye.entity.TopicType;
import com.tueye.entity.Topics;
import com.tueye.entity.user.Flowers;
import com.tueye.entity.user.User;
import com.tueye.entity.user.UserCollectionInfo;
import com.tueye.service.exception.TuEyeServiceException;

/**
 * 
 * @author yuyue Time:2008/12/23 Description: publish topic service
 */
public interface ITopicService {

	/**
	 * get all topic type
	 * 
	 * @return all topictype
	 */
	void checkTopicTypeFolds();

	/**
	 * get the topicType object through the indexkey
	 * 
	 * @return topictype
	 */
	TopicType getTopicTypeById(String typeid);

	/**
	 * get the topics object through the topic id;
	 * 
	 * @param id
	 *            topic id
	 * @return
	 */
	Topics getTopicById(String id);

	List<Comment> getAllCommentsByPId(String picid);

	void saveTopics(Topics topic);

	void savePicture(Pictures picture);

	Pictures getPictureById(String picid);

	void saveComment(Comment comment);

	Page pagedQueryByHQL(String hql, int pageNo, int pageSize, Object... values)
			throws TuEyeServiceException;

	void addTopicType(TopicType tt);

	public void delTopic(String id) throws TuEyeServiceException;

	public void delePictures(String hql) throws TuEyeServiceException;

	public void delePic(String id, String picpath) throws TuEyeServiceException;

	// =========add by yuyue 2009/3/3
	void saveTopicCollect(UserCollectionInfo collectinfo);

	void saveFlower(Flowers flower);

	void updateTopic(Topics topic);

	// add by yuyue 2009/3/31
	int getCommentsNumByTopicId(String topicid);

	// add by yuyue 2009/4/10
	User getUserByTopic(Topics topic);

	// modify by yuyue 09.5.26
	List queryBysql(String sql);

	public List<Topics> getTopicsByHql(String hql) throws TuEyeServiceException;

	public Map<String, Object> getDingOrCaiNum(String topicid)
			throws TuEyeServiceException;

	public String getClickNumByTopicId(String topicid)
			throws TuEyeServiceException;
	List getFlowerByTopicsId(String topicsId);
}
